﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using iShoppingDTO;

namespace iShoppingDAO
{
    public class CityDAO
    {
        public static List<CityDTO> getCitys() {
            List<CityDTO> citys = new List<CityDTO>();
            try
            {

                string sql = "SELECT * FROM City";
                DataTable dt = DataProvider.ExecuteQuery(sql);

                int i, n = dt.Rows.Count;
                for (i = 0; i < n; i++)
                {
                    CityDTO city = new CityDTO();
                    city.Ten = dt.Rows[i]["Ten"].ToString();
                    citys.Add(city);
                }

            }
            catch (Exception ex)
            {
                
            }
            return citys;
        }
    }
}
